package com.作业.Day6;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;

public class Homework1 {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.setLove(0);
        dog.setName("欧欧");
        dog.setStrain("雪娜瑞犬");
        dog.setHealth(100);
        System.out.println(dog);
        dog.print();
        Penguin penguin = new Penguin();
        penguin.setName("喃喃");
        penguin.setHealth(100);
        penguin.setLove(0);
        penguin.setSex("Q妹");
        System.out.println(penguin);
        penguin.print();
    }

}

@Getter
@Setter
class Penguin extends Pet {
    String sex;

    void print() {
        System.out.println("我的性别" + sex);
    }
}

@Data
class Pet {
    String name;
    int health;
    int love;

    @Override
    public String toString() {
        return "宠物的自白:\n" + "我的名字叫" + name + "我的健康值为100" + "我和主人的亲密度为" + love ;
    }
}

@Getter
@Setter
class Dog extends Pet {
    String strain;

    void print() {
        System.out.println("我是一只" + strain);
    }
}
